<script>
const worker = new Worker(`fetch_from_worker.js`);

let resolve;
worker.onmessage = e => { resolve(e.data); };

function fetch_from_worker(url) {
  let p = new Promise(r => { resolve = r; });
  worker.postMessage({url});
  return p;
}
</script>
